{% extends "base.html" %} {% block title %}Vendors{% endblock %} {% block content %} {% block subnav %} {% include "subnav.html" %} {% endblock %} {% if session['role'] == 'manager' %}

Vendors

{% elif session['role'] == 'admin' %}

Vendors

{% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, msg in messages %}
{{ msg }}
{% endfor %} {% endif %} {% endwith %}

Add Vendor

Upload from CSV
Only .csv files are supported.
{% endif %}

Existing Vendors

{% set columns = [ ('vendor_id', 'ID'), ('name', 'Name'), ('contact_name', 'Contact Name'), ('phone', 'Phone'), ('email', 'Email'), ('address', 'Address') ] %} {% for field, label in columns %} {% endfor %} {% if session['role'] == 'admin' %} {% endif %} {% for vendor in vendors %} {% if session['role'] == 'admin' %} {% endif %} {% endfor %}
{{ label }} {% if sort == field %} {{ '↑' if direction == 'asc' else '↓' }} {% endif %} Actions
{{ vendor.vendor_id }} {{ vendor.name }} {{ vendor.contact_name or '' }} {{ vendor.phone or '' }} {{ vendor.email or '' }} {{ vendor.address or '' }} Delete
{% endblock %}